package cn.butcher21.controller;

import cn.butcher21.dao.DaoWork;
import cn.butcher21.dao.DaoWorkImpl.DaoWorkImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;

@WebServlet(name = "TeacherEvaluateServlet", value = "/evaluate")
public class TeacherEvaluateServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String id = request.getParameter("id"); // 项目id
        String date = request.getParameter("date"); // 打卡日期
        String evaluate = request.getParameter("evaluate");
        DaoWork daoWork = new DaoWorkImpl();
        try {
            daoWork.update(id, date, evaluate);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
